 /**
 * 子模块路由
 * dlq
 */

var router = function($urlRouterProvider, $stateProvider){


 	$stateProvider
 
	
 	//产品模板
 	//分销商
	.state('app.product_template', {
		url: '/product/template.html',
		views: {
	 
		    'main@' : {
		    	template : require('./views/template.html'),
		        controller : 'template'
		    }
		}
	})



    //创建产品1
	.state('app.product_create', {
		url: '/product/create.html',
		views: {
			'main@' : {
				template : require('./views/create.html'),
				controller : 'create'
			}
		}
    })



    // Advanced Datatables
    .state('app.product_list', {
        url: "/product/list.html",
        views: {
			'main@' : {
				template : require('../996tpl/views/table.html'),
				controller : 'list',
			}
		},
		resolve:{
            tableconfig : function(tableservice){
                return tableservice.tableconfig();
            }
        }
    })

    //产品列表-申请上架
    .state('app.applyingProductList', {
        url: "/applyingProduct/list.html",
        views: {
			'main@' : {
				template : require('../996tpl/views/table.html'),
				controller : 'productApplyingProductList',
			}
		},
		resolve:{
            tableconfig : function(tableservice){
                return tableservice.tableconfig();
            }
        }
    })

    //产品列表-审核通过等待上架
    .state('app.examinedProductList', {
        url: "/examinedProduct/list.html",
        views: {
			'main@' : {
				template : require('../996tpl/views/table.html'),
				controller : 'productExaminedProductList',
			}
		},
		resolve:{
            tableconfig : function(tableservice){
                return tableservice.tableconfig();
            }
        }
    })

    //销售中
    .state('app.salingProductList', {
        url: "/salingProduct/list.html",
        views: {
			'main@' : {
				template : require('../996tpl/views/table.html'),
				controller : 'productSalingProductList',
			}
		},
		resolve:{
            tableconfig : function(tableservice){
                return tableservice.tableconfig();
            }
        }
    })

    //销售结束
    .state('app.noSaleProductList', {
        url: "/noSaleProduct/list.html",
        views: {
			'main@' : {
				template : require('../996tpl/views/table.html'),
				controller : 'productNoSaleProductList',
			}
		},
		resolve:{
            tableconfig : function(tableservice){
                return tableservice.tableconfig();
            }
        }
    })

    //禁止销售
    .state('app.banSaleProductList', {
        url: "/banSaleProduct/list.html",
        views: {
			'main@' : {
				template : require('../996tpl/views/table.html'),
				controller : 'productBanSaleProductList',
			}
		},
		resolve:{
            tableconfig : function(tableservice){
                return tableservice.tableconfig();
            }
        }
    })




    //景区简表
  //   .state('app.product_temp', {
  //       url: "/product/temp.html",
  //       views: {
		// 	'main@' : {
		// 		template : require('./views/temp.html'),
		// 		controller : 'producttemp',
		// 	}
		// },
		// resolve:{
           
  //       }
  //   })

    .state('app.product_temp', {
        url: "/product/temp",
        template : require('./views/temp.html'),
        'size' : 'lg',
        controller : 'producttemp',
        // resolve : {  
            
        // }  
    })





	;

};

module.exports = router;